package com.demo7;

/**
 * Created by Administrator on 2017/3/27.
 */
class Father {
    String str = "父类的Str成员变量";
}

class Son extends Father {
    String str = "子类的Str成员变量";
}

public class FengZhuang4 {
    public static void main(String[] args) {
        Father father = new Father();
        Son son = new Son();
        System.out.println("父类对象访问Str: ");
        System.out.println(father.str);
        System.out.println("子类对象访问Str: ");
        System.out.println(son.str);
    }
}
